Tryit Editor v2.3

Edit This Code:
<!DOCTYPE html> <html> <body> <p id="demo" ondblclick="myFunction()">Double-click me to change my text color.</p> <p>A function is triggered when the p element is double-clicked. The function sets the color of the p element to red.</p> <script> function myFunction() { document.getElementById("demo").style.color = "red"; } </script> </body> <!-- Mirrored from www.w3schools.com/tags/tryit.asp?filename=tryhtml5_ev_ondblclick2 by HTTrack Website Copier/3.x [XR&CO'2014], Fri, 23 Jan 2015 08:09:14 GMT --> </html>
Result:
Try it Yourself - © w3schools.com